$(function(){
	$(".log-btn").on("click",function(){
        uname = $("#num").val();
        upass = $("#pass").val();
        remember_pass = $("input[type='checkbox']").is(':checked');

        if(remember_pass){
            remember_pass=1;
        }else{
            remember_pass=0;
        }


        if(uname==""||upass==""){
            alert("账户或密码不能为空！");
            return false;
        }

        $.post("/index/Login/index",{"uname":uname,"upass":upass,"remember_pass":remember_pass},function(e){
            if(e=="ok"){
                window.location.href="/index/Index/index";
            }else{
                alert("账号或密码错误！");
            }
        });
	});


});

$("body").keydown(function() {
    if (event.keyCode == 13) {//keyCode=13是回车键
        $('.log-btn').click();
    }
});


